/* ************************************************************************** */ 
/* Example of a syndication feed reader using the Project Rome API with       */ 
/* BSF4ooRexx                                                                 */ 
/* current version of Rome: rome1.0.jar            https://rome.dev.java.net/ */ 
/* You need to implement this API plus the JDOM API                           */ 
/* jdom.jar  ,   you can find this at               https://jdom.org/        ; */ 
/*                                                                            */ 
/* This class retrieves a syndfeed from the web and prints some               */ 
/* information about the feed using                                           */ 
/* "com.sun.syndication.io.SyndFeedInput" methods                             */                        
/* created by Martin Stoppacher     date:   26.12.2009                        */ 
/* license:ÊÊÊÊLGPL 3.0ÊÊÊÊÊÊÊused versions: Java 1.6, ooRexx 4.0, Bsf4ooRexx */
/*             (Lesser Gnu Public License version 3.0),                       */ 
/*             cf. <http://www.gnu.org/licenses/lgpl.html>                    */ 
/* ************************************************************************** */ 

say hello this reads a syndfeed 
--say please type in the url    
--pull url
/* The url String is predefined in this example, to change the feed url       */ 
/* replace to String in this file or use one of the above methods             */ 
url="http://rss.orf.at/fm4.xml" 
feedUrl=.bsf~new("java.net.URL", url)   /* create an instance of java.net.URL */ 
say connecting__ || feedUrl~getAuthority() 

input=.bsf~new("com.sun.syndication.io.SyndFeedInput")  
/*                                Parses an XML document into an SyndFeedImpl */ 
xmlr=.bsf~new("com.sun.syndication.io.XmlReader", feedUrl) 
/*     Figures out the charset encoding of the XML document within the stream */ 
feed= input~build(xmlr)  
/*      Builds a SyndFeedImpl from an Reader , also possible with SAX or DOM  */ 
call syssleep(2)                                             /* sleep by Rexx */ 
say connected 
say "----" 
say "The Title of the feed is:" 
say feed~getTitle()                                 /* Returns the feed title */ 
sl = BSF("sleep",2) 
say "----" 
say "The URI of the feed is:" 
say feed~getUri()                                    /* Returns the feed URI  */ 
sl = BSF("sleep",2) 
say "----" 
say "The Author of the feed is:" 
say feed~getAuthor()      
/*    Returns the name of the first--feed author in the collection of authors */ 
sl = BSF("sleep",2) 
say "----" 
say "The copyright of the feed is:"  
say feed~getCopyright()                         /* Returns the feed copyright */  
sl = BSF("sleep",2) 
say "----" 
say "The description of the feed is:" 
say feed~getDescription()                     /* Returns the feed description */ 
sl = BSF("sleep",2) 
say "----" 
say "The encoding of the feed is:" 
say feed~getEncoding()          /* Returns the charset encoding of a the feed */ 
say "----" 

sl = BSF("sleep",2)                       /* sleep by using a BSF subfunktion */ 
say just a break; 
sl = BSF("sleep",2)                       /* sleep by using a BSF subfunktion */ 

say "----" 
aut= feed~getAuthors()           /* Returns the feed authors , java.util.List */ 
say aut 
say this is the Authors object 
say "----" 
array = feed~getEntries()        /* Returns the feed entries , java.util.List */ 
say array  
say "this is the entries-array object" 

::requires BSF.cls                     /* get the Java support                */